#pragma once
#include "About_Window.h"
#include "XML_Handler.h"
#include "Network_Handler.h"

#include <cliext/vector>
namespace Artemis_Client {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	using namespace System::Threading;
	using namespace cliext;

	/// <summary>
	/// Summary for Main_Window
	/// </summary>
	public ref class Main_Window : public System::Windows::Forms::Form
	{
	public:
//		std::vector<System::Windows::Forms::TabPage> tabs;
		Main_Window(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Main_Window()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::MenuStrip^  menu_strip;
	private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  helpToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  lolToolStripMenuItem;
	private: System::Windows::Forms::ToolStripMenuItem^  loliToolStripMenuItem;
	private: System::Windows::Forms::StatusStrip^  statusStrip1;
	public: System::Windows::Forms::StatusStrip^  label_status_strip;
	public: System::Windows::Forms::ToolStripStatusLabel^  status_label;
	private: System::Windows::Forms::StatusStrip^  progressbar_status_strip;
	private: System::Windows::Forms::ToolStripProgressBar^  toolStripProgressBar1;
	private: System::Windows::Forms::ToolStripMenuItem^  aboutToolStripMenuItem;
	public: System::Windows::Forms::ToolTip^  toolTip1;
	private: System::Windows::Forms::TabPage^  tabPage1;
	private: System::Windows::Forms::TabControl^  tabControl1;
	private: System::Windows::Forms::ToolStripMenuItem^  newTabToolStripMenuItem;
	private: System::ComponentModel::IContainer^  components;
	private: System::Windows::Forms::DataGridView^  myDataGrid;
	private: System::Windows::Forms::ToolStripMenuItem^  dataToolStripMenuItem;
	private: vector <System::Windows::Forms::TabPage^> tabs;
	private: static array <array<String^>^>^ s = gcnew array <array<String^>^> (100);
	private: System::Windows::Forms::TextBox^  textBox1;
			 array <String^,2>^ vi;

			 

	protected: 




	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>


#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->components = (gcnew System::ComponentModel::Container());
			this->menu_strip = (gcnew System::Windows::Forms::MenuStrip());
			this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->newTabToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->dataToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->lolToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->loliToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
			this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
			this->label_status_strip = (gcnew System::Windows::Forms::StatusStrip());
			this->status_label = (gcnew System::Windows::Forms::ToolStripStatusLabel());
			this->progressbar_status_strip = (gcnew System::Windows::Forms::StatusStrip());
			this->toolStripProgressBar1 = (gcnew System::Windows::Forms::ToolStripProgressBar());
			this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
			this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
			this->myDataGrid = (gcnew System::Windows::Forms::DataGridView());
			this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->menu_strip->SuspendLayout();
			this->label_status_strip->SuspendLayout();
			this->progressbar_status_strip->SuspendLayout();
			this->tabPage1->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->myDataGrid))->BeginInit();
			this->tabControl1->SuspendLayout();
			this->SuspendLayout();
			// 
			// menu_strip
			// 
			this->menu_strip->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->fileToolStripMenuItem, 
				this->helpToolStripMenuItem});
			this->menu_strip->Location = System::Drawing::Point(0, 0);
			this->menu_strip->Name = L"menu_strip";
			this->menu_strip->Size = System::Drawing::Size(1185, 24);
			this->menu_strip->TabIndex = 0;
			this->menu_strip->Text = L"menuStrip1";
			// 
			// fileToolStripMenuItem
			// 
			this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->newTabToolStripMenuItem, 
				this->dataToolStripMenuItem, this->exitToolStripMenuItem});
			this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
			this->fileToolStripMenuItem->Size = System::Drawing::Size(37, 20);
			this->fileToolStripMenuItem->Text = L"File";
			// 
			// newTabToolStripMenuItem
			// 
			this->newTabToolStripMenuItem->Name = L"newTabToolStripMenuItem";
			this->newTabToolStripMenuItem->Size = System::Drawing::Size(121, 22);
			this->newTabToolStripMenuItem->Text = L"New Tab";
			this->newTabToolStripMenuItem->Click += gcnew System::EventHandler(this, &Main_Window::newTabToolStripMenuItem_Click);
			// 
			// dataToolStripMenuItem
			// 
			this->dataToolStripMenuItem->Name = L"dataToolStripMenuItem";
			this->dataToolStripMenuItem->Size = System::Drawing::Size(121, 22);
			this->dataToolStripMenuItem->Text = L"Data";
			this->dataToolStripMenuItem->Click += gcnew System::EventHandler(this, &Main_Window::dataToolStripMenuItem_Click);
			// 
			// exitToolStripMenuItem
			// 
			this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
			this->exitToolStripMenuItem->Size = System::Drawing::Size(121, 22);
			this->exitToolStripMenuItem->Text = L"Exit";
			this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Main_Window::exitToolStripMenuItem_Click);
			// 
			// helpToolStripMenuItem
			// 
			this->helpToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->lolToolStripMenuItem, 
				this->loliToolStripMenuItem, this->aboutToolStripMenuItem});
			this->helpToolStripMenuItem->Name = L"helpToolStripMenuItem";
			this->helpToolStripMenuItem->Size = System::Drawing::Size(44, 20);
			this->helpToolStripMenuItem->Text = L"Help";
			// 
			// lolToolStripMenuItem
			// 
			this->lolToolStripMenuItem->Name = L"lolToolStripMenuItem";
			this->lolToolStripMenuItem->Size = System::Drawing::Size(107, 22);
			this->lolToolStripMenuItem->Text = L"lol";
			this->lolToolStripMenuItem->Click += gcnew System::EventHandler(this, &Main_Window::lolToolStripMenuItem_Click);
			// 
			// loliToolStripMenuItem
			// 
			this->loliToolStripMenuItem->Name = L"loliToolStripMenuItem";
			this->loliToolStripMenuItem->Size = System::Drawing::Size(107, 22);
			this->loliToolStripMenuItem->Text = L"loli";
			this->loliToolStripMenuItem->Click += gcnew System::EventHandler(this, &Main_Window::loliToolStripMenuItem_Click);
			// 
			// aboutToolStripMenuItem
			// 
			this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem";
			this->aboutToolStripMenuItem->Size = System::Drawing::Size(107, 22);
			this->aboutToolStripMenuItem->Text = L"About";
			this->aboutToolStripMenuItem->Click += gcnew System::EventHandler(this, &Main_Window::aboutToolStripMenuItem_Click);
			// 
			// statusStrip1
			// 
			this->statusStrip1->Location = System::Drawing::Point(0, 513);
			this->statusStrip1->Name = L"statusStrip1";
			this->statusStrip1->Size = System::Drawing::Size(1185, 22);
			this->statusStrip1->TabIndex = 3;
			this->statusStrip1->Text = L"statusStrip1";
			// 
			// label_status_strip
			// 
			this->label_status_strip->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) 
				| System::Windows::Forms::AnchorStyles::Left) 
				| System::Windows::Forms::AnchorStyles::Right));
			this->label_status_strip->AutoSize = false;
			this->label_status_strip->Dock = System::Windows::Forms::DockStyle::None;
			this->label_status_strip->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->status_label});
			this->label_status_strip->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::Flow;
			this->label_status_strip->Location = System::Drawing::Point(659, 513);
			this->label_status_strip->Name = L"label_status_strip";
			this->label_status_strip->Size = System::Drawing::Size(425, 20);
			this->label_status_strip->TabIndex = 4;
			this->label_status_strip->Text = L"statusStrip2";
			this->toolTip1->SetToolTip(this->label_status_strip, L"toolStripStatusLabel1");
			// 
			// status_label
			// 
			this->status_label->MergeIndex = 1;
			this->status_label->Name = L"status_label";
			this->status_label->Overflow = System::Windows::Forms::ToolStripItemOverflow::Always;
			this->status_label->Size = System::Drawing::Size(118, 15);
			this->status_label->Text = L"toolStripStatusLabel1";
			// 
			// progressbar_status_strip
			// 
			this->progressbar_status_strip->AllowDrop = true;
			this->progressbar_status_strip->Dock = System::Windows::Forms::DockStyle::None;
			this->progressbar_status_strip->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->toolStripProgressBar1});
			this->progressbar_status_strip->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::Flow;
			this->progressbar_status_strip->Location = System::Drawing::Point(1067, 513);
			this->progressbar_status_strip->Name = L"progressbar_status_strip";
			this->progressbar_status_strip->Size = System::Drawing::Size(117, 21);
			this->progressbar_status_strip->TabIndex = 5;
			this->progressbar_status_strip->Text = L"statusStrip1";
			// 
			// toolStripProgressBar1
			// 
			this->toolStripProgressBar1->Alignment = System::Windows::Forms::ToolStripItemAlignment::Right;
			this->toolStripProgressBar1->Name = L"toolStripProgressBar1";
			this->toolStripProgressBar1->RightToLeft = System::Windows::Forms::RightToLeft::No;
			this->toolStripProgressBar1->RightToLeftLayout = true;
			this->toolStripProgressBar1->Size = System::Drawing::Size(100, 15);
			// 
			// toolTip1
			// 
			this->toolTip1->Popup += gcnew System::Windows::Forms::PopupEventHandler(this, &Main_Window::toolTip1_Popup);
			// 
			// tabPage1
			// 
			this->tabPage1->AutoScroll = true;
			this->tabPage1->Controls->Add(this->textBox1);
			this->tabPage1->Controls->Add(this->myDataGrid);
			this->tabPage1->Location = System::Drawing::Point(4, 22);
			this->tabPage1->Name = L"tabPage1";
			this->tabPage1->Padding = System::Windows::Forms::Padding(3);
			this->tabPage1->Size = System::Drawing::Size(1176, 457);
			this->tabPage1->TabIndex = 0;
			this->tabPage1->Text = L"tabPage1";
			this->tabPage1->UseVisualStyleBackColor = true;
			// 
			// myDataGrid
			// 
			this->myDataGrid->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
			this->myDataGrid->Location = System::Drawing::Point(0, 0);
			this->myDataGrid->Name = L"myDataGrid";
			this->myDataGrid->Size = System::Drawing::Size(427, 308);
			this->myDataGrid->TabIndex = 0;
			// 
			// tabControl1
			// 
			this->tabControl1->Controls->Add(this->tabPage1);
			this->tabControl1->Location = System::Drawing::Point(0, 27);
			this->tabControl1->Name = L"tabControl1";
			this->tabControl1->SelectedIndex = 0;
			this->tabControl1->Size = System::Drawing::Size(1184, 483);
			this->tabControl1->TabIndex = 6;
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(805, 61);
			this->textBox1->Name = L"textBox1";
			this->textBox1->Size = System::Drawing::Size(100, 20);
			this->textBox1->TabIndex = 1;
			// 
			// Main_Window
			// 
			this->AllowDrop = true;
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(1185, 535);
			this->Controls->Add(this->tabControl1);
			this->Controls->Add(this->progressbar_status_strip);
			this->Controls->Add(this->label_status_strip);
			this->Controls->Add(this->statusStrip1);
			this->Controls->Add(this->menu_strip);
			this->MainMenuStrip = this->menu_strip;
			this->Name = L"Main_Window";
			this->Text = L"Main_Window";
			this->menu_strip->ResumeLayout(false);
			this->menu_strip->PerformLayout();
			this->label_status_strip->ResumeLayout(false);
			this->label_status_strip->PerformLayout();
			this->progressbar_status_strip->ResumeLayout(false);
			this->progressbar_status_strip->PerformLayout();
			this->tabPage1->ResumeLayout(false);
			this->tabPage1->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->myDataGrid))->EndInit();
			this->tabControl1->ResumeLayout(false);
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
			 {
				 Application::Exit();
			 }
	private: System::Void lolToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
			 {
				 Socket^ soc = Network_Handler::Connect_Server();
// 				 this->status_label->Text = doc->InnerText;
// 				 this->toolTip1->SetToolTip (this->label_status_strip, this->status_label->Text);
			 }
private: System::Void loliToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
// 			 this->status_label->Text = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm";
// 			 this->toolTip1->SetToolTip (this->label_status_strip, this->status_label->Text);
			 Network_Handler^ n = gcnew Network_Handler();
			 String^ str = gcnew String("");
			 n->Send_XML(str);
			 textBox1->Text = "Sent" + str;
		 }
private: System::Void aboutToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			About_Window a;
			a.ShowDialog();
		 }
private: System::Void toolTip1_Popup(System::Object^  sender, System::Windows::Forms::PopupEventArgs^  e) {
		 }
private: System::Void newTabToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e)
		 {
			 this->tabControl1->Controls->Add(tabInitilize ());
		 }
private: System::Windows::Forms::TabPage^ tabInitilize ()
		 {
			 System::Windows::Forms::TabPage^ t1 = gcnew System::Windows::Forms::TabPage();
			 this->tabs.push_back(t1);
			 return this->tabs.at(0);
		 }

private: System::Void dataToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 for (int i=0; i<100; i++)
			 {
				 s[i] = gcnew array<String^> (3);
				 for (int j = 0; j<3; j++)
				 {
					 this->s[i][j] = "Data: Row " + i + ", Column " + j + ".";
				 }
			 }
			 myDataGrid->ColumnCount = 3;
			 myDataGrid->Columns[0]->Name = "Col 1";
			 myDataGrid->Columns[1]->Name = "Col 2";
			 myDataGrid->Columns[2]->Name = "Col 3";
			 for (int i=0; i<100; i++)
			 {
				 myDataGrid->Rows->Add(s[i]);
			 }
//			 tabPage1->SetBoundsCore(tabPage1->Left, tabPage1->Top, myDataGrid->Width, myDataGrid->Height, All);
//			 tabPage1->
		 }
};
}
